<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ include file="config.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Insert title here</title>
	<link href="css/adminUserManage.css" rel="stylesheet"/>
<script type="text/javascript" src="${ctx}/js/adminUserManage.js"></script>
</head>
<body>
<div class="handler4">	
	<div>
		<span>注册用户管理</span><br/><br/>
		
		<table class="myTable1" >
			<tr class="tr2">
				<td class="td1"><span>用户名：<input id="userId" type="text" value="${id}" /></td>
				<td class="td1"><span>性别：</span><select id="sex">
					<option value="" <c:if test="${sex == ''}">selected</c:if>>---请选择---</option>
					<option value="男" <c:if test="${sex == '男'}">selected</c:if>>男</option>
					<option value="女" <c:if test="${sex == '女'}">selected</c:if>>女</option>
				</select></td>
				<td class="td1"><span>状态：</span><select id="state">
					<option value="-1" <c:if test="${state == '-1'}">selected</c:if>>---请选择---</option>
					<option value="1" <c:if test="${state == '1'}">selected</c:if>>冻结</option>
					<option value="0" <c:if test="${state == '0'}">selected</c:if>>正常</option>
				</select></td>
				<td class="td1" ><button id="search">查询</button><button disabled="disabled">重置</button> </td>
			</tr>
		</table>
		
		<table class="myTable" >
			<tr class="tr1">
				<td class="td1"><span>用户名</span></td>
				<td class="td1"><span>真实姓名</span></td>
				<td class="td1"><span>性别</span></td>
				<td class="td1"><span>注册时间</span></td>
				<td class="td1">状态</td>
				<td class="td1"><span>操作</span></td>
			</tr>
			<c:forEach items="${pageUser.list}" var="user">
				<tr>
					<td class="td1"><span class="uid">${user.id}</span></td>
					<td class="td1"><span>${user.name}</span></td>
					<td class="td1"><span>${user.sex}</span></td>
					<td class="td1"><span>${user.registerdate}</span></td>
					<c:if test="${user.state == 0}">
						<td class="td1"><span class="show">正常</span></td>
						<td class="td1"><button class="dongj" value="1">冻结</button> </td>
					</c:if>
					<c:if test="${user.state == 1}">
						<td class="td1"><span class="show">冻结</span></td>
						<td class="td1"><button class="jdong" value="0">解冻</button> </td>
					</c:if>
				</tr>
			</c:forEach>
		</table>	
		</div>
		<div class="bottom">
			当前<span id="currentPage">${pageUser.currentPage + 1}</span>/<span id="totalPage">${pageUser.totalPage}</span>页，
			共${pageUser.totalCount}条记录&nbsp&nbsp&nbsp&nbsp&nbsp
			<a href="#" id="firstPage">首页</a>&nbsp&nbsp&nbsp<a href="#" id="parentPage">上一页</a> &nbsp&nbsp&nbsp&nbsp
			<a href="#" id="nextPage">下一页</a>&nbsp&nbsp&nbsp&nbsp<a href="#" id="lastPage">尾页</a>&nbsp&nbsp&nbsp&nbsp每页
			<input id="pageSize" style="width: 31px;" type="number" min="1" max="5" value="${pageUser.pageSize}">
			 条记录&nbsp&nbsp&nbsp&nbsp转到
			<select id="selectPage">
				<c:forEach begin="1" end="${pageUser.totalPage}" var="currentPage" >
					<c:choose>
						<c:when test="${(pageUser.currentPage+1) == currentPage}">
				    		<option selected="selected">${currentPage}</option>
						</c:when>
						<c:otherwise>
				    		<option>${currentPage}</option>
						</c:otherwise>
					</c:choose>
				</c:forEach>
			</select>页
		</div>
</div>
</body>
</html>